<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:f="http://java.sun.com/jsf/core">
    <body>
        <ui:composition template="./main-template.xhtml">
            <ui:param name="titulo" value="Administración del Catalogo" />
            <ui:define name="body">
                <a4j:form>
                    <table width="800" border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td width="200" valign="middle">
                                <a4j:commandButton image="/img/MiCarritoButton.png" action="#{CatalogBean.menu}">
                                    <f:param name="menu" value="verbasket"/>
                                </a4j:commandButton>
                            </td>
                            <td width="200" valign="middle"></td>
                            <td width="200" valign="middle"></td>
                            <td width="200" valign="middle">
                                <a4j:commandButton image="/img/IngresarButton.png" action="login"/>
                            </td>
                        </tr>
                    </table>
                    <rich:dataGrid id="tblMuebles" value="#{CatalogBean.productos}" var="cr" align="center" selectionMode="none" width="800px" columns="2" >
                        <table border="0px" cellpadding="0px" cellspacing="0px">
                            <tr>
                                <td width="200px" rowspan="3">
                                    <h:graphicImage value="img/img4.png" height="128px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>#{cr.referencia}: #{cr.nombre}</b><br/>
                                    #{cr.material} <br/>
                                    $ #{cr.precio}
                                </td>
                            </tr>
                            <tr>
                                <td height="12px">
                                    <a4j:commandLink action="#{CatalogBean.verDetalle}" value="Ver detalles">
                                        <f:param name="id" value="#{cr.id}"/>
                                    </a4j:commandLink>
                                    <br/>
                                    <a4j:commandLink action="#{BasketBean.add}" value="Agregar a la canasta">
                                        <f:param name="id" value="#{cr.id}"/>
                                    </a4j:commandLink>
                                </td>
                            </tr>
                        </table>
                    </rich:dataGrid >
                </a4j:form>
            </ui:define>
        </ui:composition>
    </body>
</html>